import Vue from 'vue'
import App from './App.vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)
import UI_Router from './views/UI_Router.vue'
import About from './views/About.vue'
import Contacts from './views/Contacts.vue'
import Alice from './views/Child/Alice.vue'
import All_conttacts from './views/Child/All_conttacts.vue'
import Bob from './views/Child/Bob.vue'
import son1 from './views/Child/son1.vue'
import son2 from './views/Child/son2.vue'

const routes = [
  {
    path: '/',
    redirect: '/UI_Router'
  },
  {
    path: '/UI_Router',
    component: UI_Router
  },
  {
    path: '/About',
    component: About
  },
  {
    path: '/Contacts',
    component: Contacts,
    children: [
      {
        path: 'All_conttacts',
        component: All_conttacts
      },
      {
        path: 'Alice',
        component: Alice
      },
      {
        path: 'Bob',
        component: Bob,
        children: [
          {
            path: 'son1',
            component: son1
          },
          {
            path: 'son2',
            component: son2
          },
        ]
      },
    ]
  },
]

const router = new VueRouter({
  routes
})


Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
